package cn.zy.framework.bean;

import cn.zy.framework.util.CastUtil;

import java.util.Map;

/**
 * @Author: Administrator
 * @Description:
 * @Date: Created in 11:44 2021/9/11
 * @Modified By:
 * @version: 1.0
 * 请求参数对象: 从 HttpServletRequest 对象中获取所有请求参数，并将其初始化到 Param 对象中
 */
public class Param {

	private Map<String, Object> paramMap;

	public Param(Map<String, Object> paramMap) {
		this.paramMap = paramMap;
	}

	/**
	 * 获取所有字段信息
	 */
	public Map<String, Object> getParamMap() {
		return paramMap;
	}

	/**
	 * 根据参数名获取 long 类型参数值
	 */
	public long getLong(String name) {
		return CastUtil.castLong(paramMap.get(name));
	}


}
